A Free-Format Data Input Scheme Written in Standard FORTRAN (ANSI 66)
نویسندگان
چکیده
The 1966 ANSI standard FORTRAN specifies the input of numerical data only in fixed format. Described here is a scheme, written in ANSI 66 FORTRAN, which allows numerical data prepared in accordance with the FORTRAN 77 free-format specification to be read. In addition, the scheme is designed so that ill-formed or ambiguous data are given a reasonable interpretation and the location of the suspect data and the value assumed are identified. 1. Introduction Programs written in standard FORTRAN IV are limited to data input with fixed format. Often it is more convenient to input data separated by commas or spaces and, in recognition of this, various manufacturers have introduced their own free-format data input routines. Unfortunately, these are not standard and programs and data prepared for input in free-format on one manufacturer's machine cannot, in general, be transferred to those of another manufacturer. In this paper, free-format data input routines, written in standard ANSI 66 FORTRAN (ANSI, 1966) are presented. The scheme enables data to be read into various arrangements of variables, with each routine starting to read on a new line of data and continuing until either a specified number of numbers has been read or an end of read symbol (/ or $) is encountered. In specifying the routines, the aim has been to give the correct interpretation of all well-formed numbers and, when ambiguous data are encountered, to give a reasonable interpretation and to issue a warning. A failure in the input routines can only occur from a system failure, for example if a number is too large for the computer to handle or an attempt is made to read beyond the end of a file. No 'end of file' detection facility exists in standard FORTRAN, hence this facility of FORTRAN 77 and many non-standard implementations cannot be used in standard FORTRAN 66. Whilst one of the aims in the specification of the routines has been to maintain compatibility with existing formated data for FORTRAN programs, this has not always been possible. For example, in order to read the two numbers 149 and 736 in FORTRAN 213 format, they would appear in the data as 149736. The input scheme described here would interpret this as the single number 149736. For all cases where formated data are separated by a non-digit character, the routines will read in the numbers as intended. In addition, the routines will interpret correctly …
منابع مشابه
Level and BLAS in the NAG C Library
This report describes a set of matrix vector routines Level BLAS and matrix matrix routines Level BLAS written in C These routines have been included in Mark of the NAG C Library and are used by other library routines in that library Details are given of the implementation testing and use of the routines and a complete listing of all the ANSI C function prototypes is included in the Appendix Th...
متن کاملMigrating from Fortran to Fortran with the NAGWare f and f Tools
The investment in code written in the Fortran language over the last four decades means that there is a vast amount of legacy code written to various standards and incorporating numerous vendor extensions to the language Meanwhile the new For tran standard adds many attractive new features to the language while retaining compatibility with Fortran This paper shows how the NAGWare f Tools may be...
متن کاملAn XML-Based Platform for Semantic Transformation of Numerical Programs1
We describe a simple component architecture for the development of tools for mathematically based semantic transformations of scientific software. This architecture consists of a compiler-based, language-specific front-end for source transformation, loosely coupled with one or more language-independent “plug-in” transformation modules. The coupling mechanism between the front-end and transforma...
متن کاملAn XML-Based Platform for Semantic Transformation of Numerical Programs
We describe a simple component architecture for the development of tools for mathematically based semantic transformations of scientific software. This architecture consists of compiler-based, language-specific frontand backends for source transformation, loosely coupled with one or more language-independent “plug-in” transformation modules. The coupling mechanism between the frontand back-ends...
متن کاملOn the Automaticdifferentiation of Computerprogramsandanapplicationtomultibody Systemschristian
Automatic diierentiation (AD) is a methodology for developing sensitivity-enhanced versions of arbitrary computer programs. In this paper , we provide some background information on AD and address some frequently asked questions. We introduce the ADIFOR and ADIC tools for the automatic diierentiation of Fortran 77 and ANSI-C programs, respectively , and give an example of applying ADIFOR in the...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید
ثبت ناماگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید
ورودعنوان ژورنال:
- Comput. J.
دوره 24 شماره
صفحات -
تاریخ انتشار 1981